home *** CD-ROM | disk | FTP | other *** search
/ Invisible Universe / Invisible Universe (1995)(Voyager)[Mac-PC].iso / mac / MOVIES / SHARED.DIR / 01044_Script_1044 < prev    next >
Text File  |  1995-11-21  |  8KB  |  346 lines

  1. on doRectClick theList
  2.   global gDoRectClickP, gTSEnabled, gMouseDownTime
  3.   
  4.   --put ">>>doRectClick"
  5.   
  6.   --put ">>> delta time" && ( (the ticks) - gMouseDownTime)
  7.   
  8.   if the ticks < (gMouseDownTime + 30) then exit
  9.   
  10.   
  11.   set gDoRectClickP = 0
  12.   
  13.   set p = point(¼
  14. the mouseH - the locH of sprite the clickOn, ¼
  15. the mouseV - the locV of sprite the clickOn)
  16.   
  17.   set res = 0
  18.   
  19.   set c = count(theList)
  20.   
  21.   repeat with i = 1 to c
  22.     set subList = getAt(theList, i)
  23.     set sc = count(subList) 
  24.     
  25.     repeat with j = 4 to sc
  26.       set r = getAt(subList, j)
  27.       
  28.       if inside(p, r) then
  29.         set res = subList 
  30.         exit repeat
  31.       end if
  32.       
  33.     end repeat
  34.     
  35.     if res <> 0 then exit repeat
  36.     
  37.   end repeat
  38.   
  39.   
  40.   if res = 0 then 
  41.     --put ">>>doRectClick, clearing hot spot"
  42.     if gTSEnabled then clearHotSpotText
  43.     exit
  44.   end if
  45.   
  46.   
  47.   --put ">>>doRectClick: " & res
  48.   set gDoRectClickP = 1
  49.   
  50.   set theType = getAt(res, 1) 
  51.   
  52.   if theType = "B" then
  53.     goGo(getAt(res,2))  
  54.     exit  
  55.   end if
  56.   
  57.   if theType = "U" then
  58.     global gGlossPalette
  59.     
  60.     if voidP(gGlossPalette) then 
  61.       createGlossPalette 
  62.     end if
  63.     
  64.     tell gGlossPalette to showTermCast(getAt(res,2))
  65.     tell gGlossPalette to lOpenGlossPalette
  66.     exit  
  67.   end if
  68.   
  69.   if theType = "ERROR" then
  70.     alert "Error in doRectClick..." & the movie && theList
  71.     exit
  72.   end if
  73.   
  74. end doRectClick
  75.  
  76.  
  77.  
  78. on setNavShadow r
  79.   puppetSprite 46,1
  80.   set the stretch of sprite 46 = 0
  81.   set the castNum of sprite 46 = 1041
  82.   set the Type of sprite 46 = 1
  83.   set the ink of sprite 46 = 0
  84.   set the forecolor of sprite 46 = 255
  85.   set the backcolor of sprite 46 = 0
  86.   set the blend of sprite 46 = 100
  87.   set the locV of sprite 46 = getAt(r,2)
  88.   set the locH of sprite 46 = getAt(r,1)
  89.   updateStage
  90. end setNavShadow
  91.  
  92. on clearNavShadow
  93.   puppetSprite 46,0
  94.   updateStage
  95. end clearNavShadow
  96.  
  97.  
  98. on doDMDPopMenu theList, h, v, mark, curSel
  99.   --global gDMDPOP
  100.   
  101.   if voidP(curSel) or mark = 0 then set curSel = 0
  102.   
  103.   --set gDMDPOP = theList
  104.   
  105.   set lineCount = the number of lines in theList
  106.   if the number of chars in line lineCount of theList = 0 then
  107.     set lineCount = lineCount - 1
  108.   end if
  109.   
  110.   set len = 0
  111.   repeat with i = 1 to lineCount
  112.     if curSel > 0 then
  113.       if i = curSel then
  114.         put "ò " before line i of theList  
  115.       else  
  116.         put "  " before line i of theList
  117.       end if
  118.       
  119.     end if
  120.     
  121.     set l = the number of chars in line i of theList
  122.     if len < l then set len = l
  123.   end repeat
  124.   
  125.   --put "Length" && len
  126.   
  127.   set cn = the number of cast "test pop"
  128.   set the text of cast cn = line 1 to lineCount of theList
  129.   set the textFont of cast cn = "Courier New"
  130.   set the textStyle of cast cn = "bold"
  131.   set the textSize of cast cn = 12
  132.   set the textAlign of cast cn = "left"
  133.   
  134.   if the castNum of sprite 47 = 0 then
  135.     set sp = 47
  136.   else 
  137.     set sp = 48
  138.   end if
  139.   
  140.   puppetSprite sp,1
  141.   set the visibility of sprite sp = 0
  142.   set the castNum of sprite sp = cn
  143.   set the type of sprite sp = 7
  144.   set the ink of sprite sp = 0
  145.   updateStage
  146.   
  147.   set spV = the bottom of sprite sp - the top of sprite sp
  148.   set spH = the right of sprite sp - the left of sprite sp
  149.   
  150.   
  151.   --
  152.   --
  153.   -- h and v are the "idea" top left, but we must be sure
  154.   -- that the full menu is on the stage
  155.   --
  156.   set h = the mouseH
  157.   set v = the mouseV - 10
  158.   
  159.   set w = len * 7 + 20  
  160.   if w+h > 640 then set h = 640 - w
  161.   if spV+v > 480 then set v = 480 - spV
  162.   
  163.   set the locH of sprite sp = h
  164.   set the locV of sprite sp = v
  165.   
  166.   set the visibility of sprite sp = 1
  167.   
  168.   updateStage
  169.   
  170.   set noSel = 0
  171.   set oldLine = 0
  172.   repeat while the mouseDown
  173.     set newLine = the mouseLine
  174.     
  175.     if rollOver(sp) and newLine <> -1 then
  176.       if newLine = oldLine then next repeat
  177.       
  178.       set noSel = 0
  179.       hilite line newLine of cast cn
  180.       set oldLine = newLine
  181.       updateStage
  182.     else
  183.       if not noSel then
  184.         set oldLine = 0
  185.         set noSel = 1
  186.         set the text of cast cn = line 1 to lineCount of theList
  187.         --        hilite char 9999 to 9999 of field cn
  188.       end if
  189.       
  190.     end if
  191.     
  192.   end repeat
  193.   
  194.   if oldLine = -1 then set oldLine = 0
  195.   if not rollOver(sp) then set oldLine = 0
  196.   
  197.   set the castNum of sprite sp = 0
  198.   set the visibility of sprite sp = 0
  199.   puppetSprite sp, 0
  200.   updateStage
  201.   set the visibility of sprite sp = 1
  202.   
  203.   return oldLine
  204.   
  205. end doDMDPopMenu
  206.  
  207. on doDMDPopMenu2 cn, h, hLimit, mark, curSel
  208.   --global gDMDPOP
  209.   
  210.   set setVis = 0
  211.   if the movie = "TOUR.DIR" or the movie = "MOVIES.DIR" then
  212.     if the type of sprite 12 = 16 then
  213.       set setVis = 1
  214.       set the visible of sprite 12 = 0
  215.     end if  
  216.   end if
  217.   
  218.   if voidP(curSel) or mark = 0 then set curSel = 0
  219.   
  220.   set theList = the text of field cn
  221.   --set gDMDPOP = theList
  222.   
  223.   set lineCount = the number of lines in theList
  224.   if the number of chars in line lineCount of theList = 0 then
  225.     set lineCount = lineCount - 1
  226.   end if
  227.   
  228.   set len = 0
  229.   repeat with i = 1 to lineCount
  230.     if curSel > 0 then
  231.       if i = curSel then
  232.         put "ò " before line i of theList  
  233.       else  
  234.         put "  " before line i of theList
  235.       end if
  236.       
  237.     end if
  238.     
  239.     set l = the number of chars in line i of theList
  240.     if len < l then set len = l
  241.   end repeat
  242.   
  243.   set the text of cast cn = line 1 to lineCount of theList
  244.   set the textFont of cast cn = "Arial"
  245.   set the textStyle of cast cn = "bold"
  246.   set the textSize of cast cn = 14
  247.   set the textAlign of cast cn = "left"
  248.   
  249.   if the castNum of sprite 47 = 0 then
  250.     set sp = 47
  251.   else 
  252.     set sp = 48
  253.   end if
  254.   
  255.   puppetSprite sp,1
  256.   set the visibility of sprite sp = 0
  257.   set the castNum of sprite sp = cn
  258.   set the type of sprite sp = 7
  259.   set the ink of sprite sp = 0
  260.   updateStage
  261.   
  262.   set the locH of sprite sp = h
  263.   set the locV of sprite sp = -1
  264.   
  265.   set the visibility of sprite sp = 1
  266.   
  267.   updateStage
  268.   
  269.   set noSel = 0
  270.   set oldLine = 0
  271.   
  272.   repeat while not the mouseDown and rollOver(sp)
  273.     set newLine = the mouseLine
  274.     
  275.     if rollOver(sp) and newLine <> -1 then
  276.       
  277.       if oldLine = 1 and the mouseH > hLimit then 
  278.         set oldLine = -1 
  279.         exit repeat
  280.       end if
  281.       
  282.       if newLine = oldLine then next repeat
  283.       
  284.       set noSel = 0
  285.       hilite line newLine of cast cn
  286.       set oldLine = newLine
  287.       updateStage
  288.     else
  289.       if not noSel then
  290.         set oldLine = 0
  291.         set noSel = 1
  292.         set the text of cast cn = line 1 to lineCount of theList
  293.         --        hilite char 9999 to 9999 of field cn
  294.       end if
  295.       
  296.     end if
  297.     
  298.   end repeat
  299.   
  300.   if oldLine <> -1 and rollOver(sp) then 
  301.     
  302.     --  set noSel = 0
  303.     --  set oldLine = 0
  304.     repeat while the mouseDown
  305.       set newLine = the mouseLine
  306.       
  307.       if rollOver(sp) and newLine <> -1 then
  308.         if newLine = oldLine then next repeat
  309.         
  310.         set noSel = 0
  311.         hilite line newLine of cast cn
  312.         set oldLine = newLine
  313.         updateStage
  314.       else
  315.         if not noSel then
  316.           set oldLine = 0
  317.           set noSel = 1
  318.           set the text of cast cn = line 1 to lineCount of theList
  319.           --        hilite char 9999 to 9999 of field cn
  320.         end if
  321.         
  322.       end if
  323.       
  324.     end repeat
  325.   end if
  326.   
  327.   
  328.   if oldLine = -1 then set oldLine = 0
  329.   if not rollOver(sp) then set oldLine = 0
  330.   
  331.   set the castNum of sprite sp = 0
  332.   set the visibility of sprite sp = 0
  333.   puppetSprite sp, 0
  334.   
  335.   if setVis then
  336.     set the visible of sprite 12 =1  
  337.   end if
  338.   
  339.   updateStage
  340.   set the visibility of sprite sp = 1
  341.   
  342.   return oldLine
  343.   
  344. end doDMDPopMenu2
  345.  
  346.